home *** CD-ROM | disk | FTP | other *** search
/ The Very Best of Atari Inside / The Very Best of Atari Inside 1.iso / mint / mntinc25 / compiler.h < prev    next >
C/C++ Source or Header  |  1992-12-12  |  4KB  |  178 lines

  1. /* compiler specific defines */
  2. /* this file is guaranteed to be included exactly once if you include
  3.    anything at all. all site-dependent or compiler-dependent stuff
  4.    should go here!!!
  5.  */
  6.  
  7. #ifndef _COMPILER_H
  8. #define _COMPILER_H
  9.  
  10. /* symbol to identify the library itself */
  11. #ifndef __MINT__
  12. #define __MINT__
  13. #endif
  14.  
  15. /* symbols to identify the type of compiler */
  16. #ifdef SOZOBON
  17. #define __SOZOBON__ SOZOBON
  18. #endif
  19.  
  20. #ifdef __SOZOBONC__
  21. #define __SOZOBON__ __SOZOBONC__
  22. #endif
  23.  
  24. #ifdef LATTICE
  25. #define __LATTICE__
  26. #endif
  27.  
  28. /* general library stuff */
  29. /* __SIZE_TYPEDEF__:     the type returned by sizeof() */
  30. /* __PTRDIFF_TYPEDEF__: the type of the difference of two pointers */
  31. /* __WCHAR_TYPEDEF__:     wide character type (i.e. type of L'x') */
  32. /* __EXITING:           the type of a function that exits */
  33. /* __CDECL:             function must get parameters on stack */
  34.         /* if !__CDECL, passing in registers is OK */
  35.  
  36. /* symbols to report about compiler features */
  37. /* #define __NEED_VOID__    compiler doesn't have a void type */
  38. /* #define __MSHORT__        compiler uses 16 bit integers */
  39. /* (note that gcc and C68 define this automatically when appropriate) */
  40.  
  41. #ifdef __GNUC__
  42. #ifndef sun
  43. #  define __SIZE_TYPEDEF__ unsigned long
  44. #  define __PTRDIFF_TYPEDEF__ long
  45. #  define __WCHAR_TYPEDEF__ int
  46. #else
  47. #  /* sun always seems to have an agenda of their own */
  48. #  include <sys/stdtypes.h>
  49. #  define __SIZE_TYPEDEF__ int          /* can you believe this!! */
  50. #  define __PTRDIFF_TYPEDEF__ int       /* or this!! */
  51. #  define __WCHAR_TYPEDEF__ unsigned short /* this seems reasonable */
  52. #  define _SIZE_T __SIZE_TYPEDEF__
  53. #  define _WCHAR_T __WCHAR_TYPEDEF__
  54. #endif
  55. #define __EXITING volatile void
  56. #ifndef __NO_INLINE__
  57. # define __GNUC_INLINE__
  58. #endif
  59. #endif
  60.  
  61. #ifdef __LATTICE__
  62. #define __SIZE_TYPEDEF__ unsigned long
  63. #define __PTRDIFF_TYPEDEF__ long
  64. #define __WCHAR_TYPEDEF__ char
  65. #define __EXITING void
  66. #ifdef _SHORTINT
  67. # define __MSHORT__
  68. #endif
  69. #endif
  70.  
  71. #ifdef __C68__
  72. #define __SIZE_TYPEDEF__ unsigned long
  73. #define __PTRDIFF_TYPEDEF__ long
  74. #define __WCHAR_TYPEDEF__ char
  75. #define __EXITING void
  76. #endif
  77.  
  78. #ifdef __SOZOBON__
  79. /*
  80.  * Temporary hacks to overcome 1.33i's short symbol names. Hopefully future
  81.  * versions will allow the extended Sozobon symbol format.
  82.  */
  83. #define _mallocChunkSize _sc_mCS
  84. #define _malloczero _sc_mz
  85. #define _console_read_byte _sc_crb
  86. #define _console_write_byte _sc_cwb
  87.  
  88. /* Doesn't know (void *) is special (but can handle it); this works better. */
  89. #define __NULL (0L)
  90. #ifdef OLD_SOZOBON
  91. #define void char
  92. #endif
  93. #define __SIZE_TYPEDEF__ unsigned int
  94. #define __PTRDIFF_TYPEDEF__ long
  95. #define __WCHAR_TYPEDEF__ char
  96. #define __EXITING void
  97. #define __MSHORT__
  98. #endif /* __SOZOBON__ */
  99.  
  100. #ifdef __TURBOC__
  101. #ifndef __STDC__
  102. #  define __STDC__ 1
  103. #endif
  104. #define __SIZE_TYPEDEF__ unsigned long
  105. #define __PTRDIFF_TYPEDEF__ long
  106. #define __WCHAR_TYPEDEF__ char
  107. #define __EXITING void
  108. #define __MSHORT__
  109. #define __VA_LIST__ void *
  110. #define __CDECL cdecl
  111. #endif /* __TURBOC__ */
  112.  
  113. #if defined(__hpux) && (!defined(__GNUC__))
  114. #define __SIZE_TYPEDEF__ unsigned int
  115. #define __PTRDIFF_TYPEDEF__ int
  116. #define __WCHAR_TYPEDEF__ unsigned int
  117. #define __EXITING void
  118. #endif
  119.  
  120. /* some default declarations */
  121. /* if your compiler needs something
  122.  * different, define it above
  123.  */
  124. #ifndef __VA_LIST__
  125. #define __VA_LIST__ char *
  126. #endif
  127.  
  128. #ifndef __CDECL
  129. #define __CDECL
  130. #endif
  131.  
  132. #ifndef __NULL
  133. #  ifdef __MSHORT__
  134. #    define __NULL ((void *)0)
  135. #  else
  136.      /* avoid complaints about misuse of NULL :-) */
  137. #    define __NULL (0)
  138. #  endif
  139. #endif
  140.  
  141. #ifdef __cplusplus
  142. # define __EXTERN
  143. # define __PROTO(x) x
  144. #else
  145. # ifdef __STDC__
  146. #  ifndef __NO_PROTO__
  147. #    define __PROTO(x) x
  148. #  endif
  149. #  define __EXTERN
  150. # else
  151. #  define __EXTERN extern
  152. /*
  153.  * fudge non-ANSI compilers to be like ANSI
  154.  */
  155. #  define const
  156. #  define volatile
  157.  
  158. #  ifdef __NEED_VOID__
  159. typedef char void;    /* so that (void *) is the same as (char *) */
  160.     /* also lets us know that foo() {...} and void foo() {...} are
  161.        different */
  162. #  endif
  163. # endif /* __STDC__ */
  164. #endif /* __cplusplus */
  165.  
  166. #ifndef __PROTO
  167. #define __PROTO(x) ()
  168. #endif
  169.  
  170. /* macros for POSIX support */
  171. #ifndef __hpux
  172. #define _UID_T unsigned short
  173. #define _GID_T unsigned short
  174. #define _PID_T int
  175. #endif
  176.  
  177. #endif /* _COMPILER_H */
  178.